<load href="__PUBLIC__/kindeditor/themes/default/default.css" />
<load href="__PUBLIC__/kindeditor/kindeditor.js" />
<load href="__PUBLIC__/kindeditor/lang/zh_CN.js" />
<form class="form-horizontal" role="form" action="__ACTION__" method="post">
    <div class="form-group">
        <label class="col-sm-2 control-label">上级栏目</label>
        <div class="col-sm-4">
            <input type="text" class="form-control" value="{$category['title']|default='无'}" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">栏目名称</label>
        <div class="col-sm-4">
            <input type="text" name="title" class="form-control" value="{$info.title}" />
        </div><span class="help-block">（名称不能为空）</span>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">网页标题</label>
        <div class="col-sm-4">
            <input type="text" name="meta_title" class="form-control" value="{$info.meta_title|default=''}" />
        </div>
    </div>
    <div class="form-group">
            <label class="col-sm-2 control-label">关键字</label>
            <div class="col-sm-4">
                <textarea name="keywords" class="form-control" rows="3">{$info.keywords|default=''}</textarea>
            </div>
        </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">描述</label>
        <div class="col-sm-4">
            <textarea name="description" class="form-control" rows="3">{$info.description|default=''}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">列表模板</label>
        <div class="col-sm-4">
            <select class="form-control" name="template_lists">
                    <option value="">----请选择----</option>
                 <foreach name="selected_list" item="vo">
                    <option value="{$key}" <if condition="$info['template_lists'] eq $key">selected</if>>{$vo}</option>
                 </foreach>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">详情模板</label>
        <div class="col-sm-4">
            <select class="form-control" name="template_detail">
                <option value="">----请选择----</option>
                <foreach name="selected_cont" item="vo">
                    <option value="{$key}">{$vo}</option>
                </foreach>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">模型选择</label>
        <div class="col-sm-4">
            <volist name=":get_document_model()" id="list">
            <label class="radio-inline">
                <input type="radio" name="model" <if condition="$info['model'] eq $list['id']">checked</if> id="inlineRadio1" value="{$list.id}"> {$list.title}
            </label>
            </volist>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">栏目图标</label>
        <div class="col-sm-4">
        <input type="text" name="icon" class="form-control" id="url1" value="" /> <input type="button" id="image1" value="选择图片" />
            <div id="de_img" style="clear:both;" ><img class="img-rounded" style="margin:10px;width:260px;border:1px solid #DDDDDD;padding:5px;background:#FCFCFC;" src="{$info.icon|default=$defaultimg}"/></div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input type="hidden" name="pid" <if condition="$pid neq ''">value="{$pid}"<else />value="{$info['pid']}"</if> />
            <input type="hidden" name="id" value="{$info['id']}" />
            <button type="submit" class="btn btn-primary">提交</button>
            <button class="btn btn-info btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </div>
</form>

<script>
    KindEditor.ready(function(K) {
        var editor = K.editor({
            allowFileManager : true
        });
        K('#image1').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    imageUrl : K('#url1').val(),
                    clickFn : function(url, title, width, height, border, align) {
                        K('#url1').val(url);
                        K('#de_img').html('<img style=\'margin:10px;width:260px;border:1px solid #DDDDDD;padding:5px;background:#FCFCFC;\' src='+url+'>');
                        editor.hideDialog();
                    }
                });
            });
        });
    });
</script>